package ace.module.product.core.impl.dao.entity;

import jakarta.annotation.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.Table;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.io.Serializable;
import ace.cmp.spring.data.jdbc.querydsl.core.annotations.LogicDelete;
import ace.cmp.spring.graphql.core.model.GenericPageContent;
import ace.module.product.api.model.dto.PmsCategoryDto;

/**
* 商品分类.
*
* @author Caspar
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = PmsCategoryDto.TABLE_DESC)
@Table(PmsCategoryDto.TABLE_NAME)
public class PmsCategory implements Serializable, GenericPageContent<Long> {

  @Id
  @Schema(title = PmsCategoryDto.ID_TITLE, description = PmsCategoryDto.ID_DESC)
  private Long id;

  @Schema(title = PmsCategoryDto.PMS_APP_ID_TITLE, description = PmsCategoryDto.PMS_APP_ID_DESC)
  private Long pmsAppId;

  @Schema(title = PmsCategoryDto.ROOT_ID_TITLE, description = PmsCategoryDto.ROOT_ID_DESC)
  private Long rootId;

  @Schema(title = PmsCategoryDto.PARENT_ID_TITLE, description = PmsCategoryDto.PARENT_ID_DESC)
  private Long parentId;

  /**
   * {@link ace.module.product.api.enums.PmsCategoryTypeEnum}
   */
  @Schema(title = PmsCategoryDto.TYPE_TITLE, description = PmsCategoryDto.TYPE_DESC)
  private Integer type;

  @Schema(title = PmsCategoryDto.LEVEL_TITLE, description = PmsCategoryDto.LEVEL_DESC)
  private Long level;

  @Size(max = 255)
  @Schema(title = PmsCategoryDto.NAME_TITLE, description = PmsCategoryDto.NAME_DESC)
  private String name;

  @Schema(title = PmsCategoryDto.DESCRIPTION_TITLE, description = PmsCategoryDto.DESCRIPTION_DESC)
  private String description;

  @Size(max = 255)
  @Schema(title = PmsCategoryDto.KEYWORDS_TITLE, description = PmsCategoryDto.KEYWORDS_DESC)
  private String keywords;

  @Schema(title = PmsCategoryDto.PIC_TITLE, description = PmsCategoryDto.PIC_DESC)
  private String pic;

  /**
   * {@link ace.module.product.api.enums.PmsCategoryShowStatusEnum}
   */
  @Schema(title = PmsCategoryDto.SHOW_STATUS_TITLE, description = PmsCategoryDto.SHOW_STATUS_DESC)
  private Integer showStatus;

  @Schema(title = PmsCategoryDto.SORT_TITLE, description = PmsCategoryDto.SORT_DESC)
  private Long sort;

  @LogicDelete
  @Schema(title = PmsCategoryDto.DELETE_FLAG_TITLE, description = PmsCategoryDto.DELETE_FLAG_DESC)
  private Long deleteFlag;

  @CreatedDate
  @Schema(title = PmsCategoryDto.CREATE_TIME_TITLE, description = PmsCategoryDto.CREATE_TIME_DESC)
  private Long createTime;

  @LastModifiedDate
  @Schema(title = PmsCategoryDto.UPDATE_TIME_TITLE, description = PmsCategoryDto.UPDATE_TIME_DESC)
  private Long updateTime;

  @Version
  @Schema(title = PmsCategoryDto.ROW_VERSION_TITLE, description = PmsCategoryDto.ROW_VERSION_DESC)
  private Long rowVersion;

}
